package com.bestpractice.map;

import java.util.Comparator;

public class TEST implements Comparator {

	@Override
	public int compare(Object arg0, Object arg1) {
		DEMO demo1= (DEMO)arg0;
		DEMO demo2= (DEMO)arg1;
		int val = (demo1.getName()).compareTo(demo2.getName());
		if(val>1){
			return 1;
		} else if(val <1){
			return -1;
		}else{
			if(demo1.getId()>demo2.getId()){
				return 1;
			}else{
				return -1;
			}
		}
		
	}

	
	

}
